FROM golang:1.17 AS build
WORKDIR /httpserver/
COPY . .
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
RUN GOOS=linux go build -o httpserver main.go

FROM alpine:3.14
COPY --from=build /httpserver/httpserver  /httpserver
ENTRYPOINT ["/httpserver"]

